<%@page import="Tools.ConvertUnixTime"%>
<%@page import="Entity.Category"%>
<%@page import="DAO.DAO_Category"%>
<%@page import="java.util.StringTokenizer"%>
<%@page import="org.jsoup.Jsoup"%>
<%@page import="Entity.News"%>
<%@page import="java.util.List"%>
<%@page import="java.util.List"%>
<%@page import="DAO.DAO_News"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ include file="includes/masterHeader.jsp" %>

<div class="container-fluid">
    <%@ include file="includes/masterSidebarLeft.jsp" %>
  
  <!--center-->
  <div class="col-sm-6">
<%
    DAO_News daonews = new DAO_News();
    request.setCharacterEncoding("UTF-8");
    String slug = request.getParameter("s");
    if(slug != null) {
    News anArticle = daonews.getArticle(slug);
    if(anArticle != null) {
    %>
    
    <div class="row">
      <div class="col-xs-12">
        <h2><%=anArticle.getTitle()%></h2>
        <p>
        <%=anArticle.getContent()%>
        </p>
        <p class="pull-right">
            <%
                String tags = anArticle.getTags();
                if(tags.length() > 0) {
                    StringTokenizer st = new StringTokenizer(tags, ",");
                    while(st.hasMoreTokens()) {
                        out.print("<span class=\"label label-default\" style=\"margin-right: 5px;\">"+ st.nextToken() +"</span>");
                    }
                }
            %>
            
        </p>
        <ul class="list-inline"><li><a href="#"><li><a href="#"><i class="glyphicon glyphicon-user"></i><%=anArticle.getAuthor()%></a></li><li><a href="#"><i class="glyphicon glyphicon-calendar"></i><%=ConvertUnixTime.normalTime(anArticle.getDateline())%></a></li></ul>
      </div>
    </div>
    <hr>
<%
        }
    }
%>
  </div><!--/center-->

<%@ include file="includes/masterSidebarRight.jsp" %>
  <hr>
</div><!--/container-fluid-->
<%@ include file="includes/masterFooter.jsp" %>